import pyperclip
import time
import webbrowser
import os
n=int(input('间隔时间：(>0)'))
copyBuff=' '
if n==0:
	print('傻子')
	os._exit(0)
while True:
    time.sleep(n)
    copyedText=pyperclip.paste()
    if copyBuff!=copyedText:
        copyBuff=copyedText
        normalizedText=copyBuff.replace('\r','\\r').replace('\n','\\n').replace('-\\r\\n','').replace("\\r\\n"," ")
        url='http://translate.google.cn/#en/zh-CN/'+normalizedText
        webbrowser.open(url)
    else:
        print('no change')
